/*
 * Copyright 2010-2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.pathlet.core;


import org.pathlet.core.impl.PathBeanResourceFactory;

/**
 * Convert resourcePath to full java class name.
 * It will be used in  {@link PathBeanResourceFactory}
 * @author Charlie Zhang
 * @since 2011-2-16
 */
public interface BeanPathConverter {

	/**
	 * 把 resourcePath 转换为 java class name 的全称。
	 * @param resourcePath  对应资源的路径
	 * @param basePath 资源的基础路径。是指把这个路径去掉，剩下的部分才是真正进行转为的部分。
	 * @param basePackage  the base java package name. 从哪个Java包开始。
	 * @return Java Class Name, the full class name.
	 */
	String convertToType(Path resourcePath, Path basePath, String basePackage);

	/**
	 * 通过Java类名，转换为资源路径。
	 * @param type Java Class Name
	 * @param basePath 资源的基础路径。返回结果中，会把这个路径加上。
	 * @param basePackage the base java package name. 从哪个Java包开始。
	 * @return
	 */
	Path converToPath(String type, Path basePath, String basePackage);

}
